<div class="box">
  <div class="box-heading"><?php echo $heading_title; ?></div>
  <div class="box-content" id="poll">
    <?php if ($poll_data) { ?>
      <b><?php echo $poll_data['question']; ?></b>
      <?php if (isset($answered) || isset($disabled)) { ?>
        <?php if (isset($reactions)) { ?>
          <table>
            <?php for ($i = 0; $i < 8; $i++) { ?>
              <?php if (!empty($poll_data['answer_' . ($i + 1)])) { ?>
                <tr>
                  <td style="width: 20%;"><strong><?php echo $percent[$i]; ?>%</strong></td>
                  <td><img src="catalog/view/theme/<?php echo $template; ?>/image/bars/left.png" alt="left" /><img src="catalog/view/theme/<?php echo $template; ?>/image/bars/middle.png" alt="middle" width="<?php echo $percent[$i]; ?>" height="10" /><img src="catalog/view/theme/<?php echo $template; ?>/image/bars/right.png" alt="right" /></td>
                </tr>
                <tr>
                  <td class="bottom" colspan="2"><?php echo $poll_data['answer_' . ($i + 1)]; ?></td>
                </tr>
              <?php } ?>
            <?php } ?>
            <tr>
              <td colspan="2" style="text-align: center;"><?php echo $text_total_votes . $total_votes; ?></td>
            </tr>
          </table>
          <div class="vote"><a onclick="location='<?php echo $poll_results; ?>'"><?php echo $text_poll_results; ?></a></div>
        <?php } else { ?>
          <div style="text-align: center;"><?php echo $text_no_votes; ?></div>
        <?php } ?>
      <?php } else { ?>
        <form method="post" action="<?php echo $action; ?>" id="vote">
          <table>
            <?php for ($i = 0; $i < 8; $i++) { ?>
              <?php if (!empty($poll_data['answer_' . ($i + 1)])) { ?>
              <tr>
                <td width="12%"><input type="radio" name="poll_answer" value="<?php echo $i + 1; ?>" id="answer<?php echo $i + 1; ?>" /></td>
                <td><label for="answer<?php echo $i + 1; ?>"><?php echo $poll_data['answer_' . ($i + 1)]; ?></label></td>
              </tr>
              <?php } ?>
            <?php } ?>
            <input type="hidden" name="poll_id" value="<?php echo $poll_id; ?>" />
          </table>
          <div class="vote"><a onclick="$('#vote').submit();" class="button"><span><?php echo $text_vote; ?></span></a></div>
        </form>
        <div class="vote"><a onclick="location='<?php echo $poll_results; ?>'"><?php echo $text_poll_results; ?></a></div>
      <?php } ?>
    <?php } else { ?>
      <div style="text-align: center;"><?php echo $text_no_poll; ?></div>
    <?php } ?>
  </div>
</div>
